home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-serious-
/
wb
/
merlin
/
rexx
/
secureed.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-07-12
|
2KB
|
81 lines
/* RUN "rx MCP:rexx/SecureEd.rexx %n %i" */
/* Only start programs when correct password is given within 3 tries */
Arg node_number ID /* node we were run from, Object ID */
Host = 'MCPREXX.'node_number /* the Trion MCP Arexx port */
Options results
Address value host
options failat 15
/* say "node: "node_number */
if node_number = "" then do
say "error .. rexx script not started with %n on command line"
exit 1
end
if ID = "" then do
say "error .. rexx script not started with %i or ID on command line"
exit 2
end
if ID = 10 then do /* StringGadget */
ReadString "ID 10"
string = result
GetReg "0"
tries = result
if tries < 3 then do
tries = tries + 1
SetReg "reg 0 value" tries /* increase number of tries */
if string = "test" then do /* <-- here is the password !!! */
SetReg "reg 1 value 1" /* Unlock the button(s) */
WriteString "ID 10 STRING ************" /* Erase correct password in stringgadget */
WriteString "ID 11 STRING access granted" /* Notify User */
end
else do
/* WriteString "ID 11 STRING wrong" 3 - tries "left" */
if tries = 1 then WriteString "ID 11 STRING wrong, 2 tries left"
if tries = 2 then WriteString "ID 11 STRING wrong, 1 try left"
if tries = 3 then WriteString "ID 11 STRING wrong, no tries left"
end
end
else do
WriteString "ID 11 STRING Access denied"
Pause 100
Quit
end
end
if ID = 12 then do /* Edit button , only start when access */
GetReg "1"
access = result
if access = 1 then do
Address command 'dh1:software/dtp_tekst/ced'
end
end
if ID = 13 then do /* DirWork button , only start when access */
GetReg "1"
access = result
if access = 1 then do
Address command 'DirWork'
end
end
exit 0 /* einde programma */
test: /* een functie: 'call test' */
return 0